using System;
using UnityEngine;

[CreateAssetMenu(menuName = "RPG Setup/Item Data/ItemEffect/Buff", fileName = "Item effect data - Buff ")]
public class ItemEffect_Buff : ItemEffect_DataSO
{
    [SerializeField] private float buffDuration;
    [SerializeField] private BuffEffectData[] buffs;
    private string buffName => Guid.NewGuid().ToString();

    private Player_Stats playerStats;
    public override bool CanUserBuff(Player player)
    {
        playerStats = player.playerStats;
        if (playerStats == null)
            return false;
        if (playerStats.CanUserBuff(buffName))
            return true;
        return false;
    }
    public override void ApplyEffect()
    {
        playerStats.AppayBuffEffect(buffs, buffDuration, buffName);
    }
}
